import BuffUtil from '@/BuffUtil';
import AbilityBase from 'code/Scripts/Abilities/base/AbilityBase';
/**
 * 猪人 - 鼻涕
 **/
export default class MSK_ZhuBiti extends AbilityBase {
    static instance: MSK_ZhuBiti;
    buffType: AppBuffType = {
        id: 'buff_MSK_ZhuBiti',
        art: this.art,
        name: this.abilityName,
        ubertip: this.ubertip,
        attribute: {
            附加护甲: -2,
            attackSpd_p: -0.02,
        },
        stackCountMax: -1,
        dur: 12,
        stackDurMode: true,
        isDebuff: true,
    };
    constructor(id: string = 'Mzt0') {
        super(id);
        MSK_ZhuBiti.instance = this;
        this.init();
        se.onUnitSpellEffect(this.onSpellEffect.bind(this), this.id);
    }
    init() {
        BuffUtil.registerBuffType(this.buffType);
    }
    cast<T extends Object = any>(tarX: number, tarY: number, source: unit, target: unit, data?: T): void {
        BuffUtil.addBuff(target, this.buffType.id, source);
    }
    onSpellEffect() {
        this.cast(GetSpellTargetX(), GetSpellTargetY(), GetTriggerUnit(), GetSpellTargetUnit());
    }
}
